<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HEAD>
<TITLE>知恵袋 q12114911402   javascriptでcookieに記憶と呼び出しをさせたい </TITLE>
<base href="http://kiyoto777.web.fc2.com/test/" />
<script type="text/javascript">
function show_block(){
 if(document.getElementById("box").style.display == "block"){
  document.getElementById("box").style.display   =  "none";
 }else{
  document.getElementById("box").style.display   =  "block";
 }
}

function storages_init(storages_keys,selctors){
 document.getElementById(selctors).style.display = localStorage.getItem(storages_keys); // CSSセット
}
function save() {                                                  // save 関数
 var storages_keys="box_hold";                                     // storages_keys
 var storages = "";
 storages     = localStorage.getItem(storages_keys);
 if(storages != ""){
  localStorage.removeItem("box_hold");                             // localStorage 削除
 }
 var display_value = document.getElementById("box").style.display; // ボックスのＣＳＳを求める
 localStorage.setItem("box_hold",display_value);                   // localStorage 追加
}
window.onload = function(){storages_init("box_hold","box")}
</script>
<style type="text/css">
body{
}
#fc2_qr_code_header{display:none;}
</style>
</HEAD>
<body>
<p><a href="javascript:void(0)" onclick="show_block();save();"	>非表示/表示</a></p>
<div id="box" style="display:block;" >テスト</div>
</body>
</HTML>
